package com.zijie.hosptal.pojo.po;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

import java.time.LocalDate;
import java.time.LocalDateTime;

@Data
public class DoctorSchedules {
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    @NotNull(message = "医生不能为空")
    private Integer doctorId;
    @NotNull(message = "科室不能为空")
    private Integer departmentId;
    private String workDate;
    private String name;
    @NotNull(message = "时间不能为空")
    @TableField(condition = "DATE(%s) = DATE(#{%s})")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime startTime;
    private Integer longTime;
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDate endTime;
    private String status;
    private Integer totalSlots;
    @TableField(exist = false)
    private String doctorName;
    @TableField(exist = false)
    private Integer reserveCount;
    @TableField(exist = false)
    private String departmentName;
    @TableField(exist = false)
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDate dsStartTime;
    @TableField(exist = false)
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDate dsEndTime;
}
